package com.lhjmall.ware.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lhjmall.common.utils.PageUtils;
import com.lhjmall.common.utils.Query;

import com.lhjmall.ware.dao.ProductwareDao;
import com.lhjmall.ware.entity.ProductwareEntity;
import com.lhjmall.ware.service.ProductwareService;


@Service("productwareService")
public class ProductwareServiceImpl extends ServiceImpl<ProductwareDao, ProductwareEntity> implements ProductwareService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<ProductwareEntity> page = this.page(
                new Query<ProductwareEntity>().getPage(params),
                new QueryWrapper<ProductwareEntity>()
        );

        return new PageUtils(page);
    }

	@Override
	public ProductwareEntity getByProductId(Integer productId) {
		ProductwareEntity productwareEntity=this.getOne(new QueryWrapper<ProductwareEntity>().eq("pid", productId));
		return productwareEntity;
	}

}